home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Review 28
/
Creative-Review-CD-ROM-28.iso
/
pc
/
kungfu
/
assets
/
game.dir
/
00013_Script_boss manager class
< prev
next >
Wrap
Text File
|
1997-08-08
|
3KB
|
110 lines
-- boss manager
-- --------------------------------------------------
property ancestor
property animlist
property patternlist
property channels
property speed
-- ==================================================
global ggame, gplayer, gload
-- ==================================================
-- new method
-- --------------------------------------------------
on new me, props
minit me, props
return me
end mnew
-- ==================================================
-- minit method
-- --------------------------------------------------
on minit me
-- put "in minit boss manager"
set ancestor = 0
set numochannels = 10
set lochannel = 8
set channels = []
repeat with channel = ( lochannel ) to ( lochannel + numochannels - 1)
add channels, channel
end repeat
set patternlist = data2list ( "boss pattern data" )
set datalist = data2list ( "boss anim data" )
set animlist = [:]
repeat with bossindex = 1 to count ( datalist )
set bossname = getpropat ( datalist, bossindex )
set bosslist = getat ( datalist, bossindex )
set bossanims = [:]
repeat with index = 1 to count ( bosslist )
set animcastnum = getat ( bosslist, index )
set animname = getpropat ( bosslist, index )
set theanim = data2list (animcastnum )
setaprop bossanims, animname, theanim
end repeat
setaprop animlist, bossname, bossanims
end repeat
-- put "out minit boss manager"
end minit
-- ==================================================
-- mstart method
-- --------------------------------------------------
on mstart me, screenlist
-- put "in mstart boss manager"
set dataname = getat ( checkaprop ( screenlist, #data ) , 1 )
set health = checkaprop ( screenlist, #health, 0 )
set animdata = getaprop ( animlist, dataname )
set patterndata = getaprop ( patternlist, dataname )
set props = [:]
setaprop props, #drawdata, channels
setaprop props, #animdata, animdata
setaprop props, #pattern, patterndata
setaprop props, #data, dataname
setaprop props, #health, health
set ancestor = new ( script "boss class" , props )
mload gload, dataname
mstart ancestor
-- put "out mstart boss manager"
end mstart
-- ==================================================
-- mreturnthedead method
-- --------------------------------------------------
on mreturnthedead me
-- put "in mreturnthedead"
munload gload, the data of me
mvictory gplayer
-- put "out mreturnthedead"
end mreturnthedead